var t, e = (t = require("@vant/weapp/toast/toast")) && t.__esModule ? t : {
    default: t
};
getApp();
var  n = require("../../utils/request"), o = (require("../../utils/check"), 
require("../../utils/storage")), r = require("../../utils/config");

Page({
    data: { 
        reservationList: [],
        reservationOrderImageUrl: "",
        checkeddata: {},
        pageIndex: 1,
        pageSize: 5,
        title: "点击加载更多"
    },
    onLoad: function() {},
    onShow: function() {
          this.getList(!0);
    },
    getList: function(t) {
        var o = this;
        wx.showLoading({
            title: "正在加载中...",
            mask: !0
        }), n.post1("getlist" + this.data.pageSize + "&pageIndex=" + this.data.pageIndex, {}).then(function(e) {
            if ("1" == e.code) {
                if (wx.hideLoading(), null != e.data && e.data.length > 0) {
                    var a = t ? [] : o.data.reservationList;
                    e.data.forEach(function(t) {
                        a.map(function(t) {
                            return t.id;
                        }).indexOf(t.id) <= -1 && a.push(t);
                    }), o.setData({
                        reservationList: a
                    });
                }
                (null == e.data || e.data.length <= 0) && (o.setData({
                    title: "暂无数据"
                }), wx.showToast({
                    title: "已无更多数据",
                    duration: 3e3,
                    mask: !1,
                    icon: "none"
                }));
            }
        }).catch(function(t) {
            wx.hideLoading(), console.log(t), (0, e.default)({
                message:  "sfd",
                duration: 5e3
            });
        });
    },
   
    onPopupClose: function() {
        this.setData({
            showDetailPopup: !1
        });
    },
    addMore: function() {
        var t = this.data.pageIndex + 1;
        this.setData({
            pageIndex: t
        }), this.getList(!1);
    }
});